package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateOurPayInfoDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateThirdPayInfoDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateThirdPayPageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateOurThirdPayVO;
import com.itlong.cloud.POJO.VO.operate.OperateThirdPayVO;
import com.itlong.cloud.operate.service.IOperateThirdPayService;
import com.itlong.cloud.paymenthub.IOperateThirdPayServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <desc>
 *      运营-财务管理-财务提现审核暴露接口实现类。
 * <desc/>
 *
 * @createDate 2018/09/20.
 */
@RestController
public class OperateThirdPayServiceResource implements IOperateThirdPayServiceClient {

    @Autowired
    IOperateThirdPayService iOperateThirdPayService;

    /**
     * <desc>
     *      第三方支付信息分页查询
     * <desc/>
     *
     * @param operateThirdPayPageDTO 分页查询参数
     * @return
     * @author Qiang.S
     * @createDate 2018-09-25
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/getThirdPayInfoPage",method = {RequestMethod.POST})
    public Page<OperateThirdPayVO> getThirdPayInfoPage(@RequestBody OperateThirdPayPageDTO operateThirdPayPageDTO) throws Exception{
        return iOperateThirdPayService.getThirdPayInfoPage(operateThirdPayPageDTO);
    }

    /**
     * <desc>
     *      查询第三方支付信息数量
     * <desc/>
     *
     * @param thirdPartyPayment 第三方支付 1微信支付 2银联支付
     * @return
     * @author Qiang.S
     * @createDate 2018-09-25
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/getThirdPayCount",method = {RequestMethod.POST})
    public Integer getThirdPayCount(@RequestParam("thirdPartyPayment") String thirdPartyPayment) throws Exception{
        return iOperateThirdPayService.getThirdPayCount(thirdPartyPayment);
    }

    /**
     * <desc>
     *      新增第三方支付信息
     * <desc/>
     *
     * @param operateThirdPayInfoDTO 第三方提现信息
     * @return
     * @author Qiang.S
     * @createDate 2018-09-25
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/saveThirdPayInfo",method = {RequestMethod.POST})
    public Integer saveThirdPayInfo(@RequestBody OperateThirdPayInfoDTO operateThirdPayInfoDTO) throws Exception{
        return iOperateThirdPayService.saveThirdPayInfo(operateThirdPayInfoDTO);
    }

    /**
     * <desc>
     *      物业提现规则设置
     * <desc/>
     *
     * @param operateOurPayInfoDTO 公司提现规则
     * @return
     * @author Qiang.S
     * @createDate 2018-09-20
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/saveOurPayInfo",method = {RequestMethod.POST})
    public Integer saveOurPayInfo(@RequestBody OperateOurPayInfoDTO operateOurPayInfoDTO) throws Exception{
        return iOperateThirdPayService.saveOurPayInfo(operateOurPayInfoDTO);
    }

    /**
     * <desc>
     *      查询第三方支付详细信息
     * <desc/>
     *
     * @param paymentManagementId 支付管理ID 逻辑ID
     * @return
     * @author Qiang.S
     * @createDate 2018-09-25
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/getThirdPayDetail",method = {RequestMethod.POST})
    public OperateThirdPayVO getThirdPayDetail(@RequestParam("paymentManagementId") String paymentManagementId) throws Exception{
        return iOperateThirdPayService.getThirdPayDetail(paymentManagementId);
    }

    /**
     * <desc>
     *      获取物业提现规则
     * <desc/>
     *
     * @return
     * @author Qiang.S
     * @createDate 2018-09-25
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/getOurPayInfo",method = {RequestMethod.POST})
    public OperateOurThirdPayVO getOurPayInfo() throws Exception{
        return iOperateThirdPayService.getOurPayInfo();
    }

    /**
     * <desc>
     *      修改状态
     * <desc/>
     *
     * @param paymentManagementId 支付管理ID
     * @param status 支付管理ID  1正常 2禁用
     * @return
     * @author Qiang.S
     * @createDate 2018-09-20
     */
    @Override
    @RequestMapping(path="/operate/finance/thirdPay/updateStatus",method = {RequestMethod.POST})
    public Integer updateStatus(@RequestParam("paymentManagementId") String paymentManagementId,@RequestParam("status") String status) throws Exception{
        return iOperateThirdPayService.updateStatus(paymentManagementId,status);
    }

}
